var express = require('express');
var router = express.Router();
var SqliteDB = require('./sqlite3db').SqliteDB;


/* GET users listing. */
router.get('/', function(req, res, next) {
  var sdb = new SqliteDB('db/user.db');
  var stus='';
  sdb.queryData("select * from student where name like '" + req.query.s + "%'", function(data){
    // req.session.username = req.params.username;
    // if(!req.session.username){
    //   res.end();
    // }
    if(data.length>0){
      stus = JSON.stringify(data);
    }
    res.send(stus);
  });  
});

module.exports = router;
